package com.itheima.d04_api_array_sort2;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 学生实体类
 */
@NoArgsConstructor
@AllArgsConstructor
@Data  //@Getter\@Setter\@ToString
public class Student  implements Comparable<Student>{
    private String name;
    private double height;
    private int age;

    @Override
    public int compareTo(Student o) {
        return this.getAge()-o.getAge() ;
    }
}
